//
//  CommunicationDelegate.m
//  myNovaMobile
//
//  Created by Taylor Clifton on 2/5/10.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "CommunicationDelegate.h"

@implementation CommunicationDelegate

@synthesize responseData;

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
	NSLog(@"Request: Did Receive Response");
	responseData = [[NSMutableData data] retain];
    [responseData setLength:0];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
	NSLog(@"Request: Did Receive Data");
    [responseData appendData:data];
}

- (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error {
	NSLog(@"Request: Did Fail With Error");
    // Show error
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
	NSLog(@"Request: Did Finish Loading");
	NSLog(@"Data: %s", [responseData bytes]);
    // Once this method is invoked, "responseData" contains the complete result
}

@end
